import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取可以所有的
 * @param {String} key 
 * @returns 
 */
export function hash_hscan({key,cursor,match,size,page_size}) {
  return request({
    url: '/api/key/hash/hscan',
    method: 'post',
    timeout:100000,
    data: qs.stringify({
      key,cursor,match,size,page_size
    })
  })
}

export function hash_hdel(key,field) {
  return request({
    url: '/api/key/hash/hdel',
    method: 'post',
    data: qs.stringify({
      key,field
    })
  })
}




export function hash_hget(key,field) {
  return request({
    url: '/api/key/hash/hget',
    method: 'post',
    data: qs.stringify({
      key,field
    })
  })
}


export function hash_hset(key,cover,adds) {
  return request({
    url: '/api/key/hash/hset',
    method: 'post',
    data: qs.stringify({
      key,cover,
      adds: JSON.stringify(adds)
    })
  })
}

export function hash_hedit(key,field,oldValue,value) {
  return request({
    url: '/api/key/hash/hedit',
    method: 'post',
    data: qs.stringify({
      key,field,oldValue,value
    })
  })
}

